<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title></title> 
</head>
<body>

<script type="text/javascript">
	onload = function(){

		function a(){ alert(1)};
		
		function b(){
			return function(){
				alert(1);
			}
		}
		
		document.getElementById('ipt').onclick = b();
	}
</script>
</body>
<input type='button' value='d' id='ipt'>
</html>